#include <iostream>
#include <vector>
using namespace std;

int a[] =
{
0,
1,
2,
2,
4,
4,
6,
6,
10,
10,
14,
14,
20,
20,
26,
26,
36,
36,
46,
46,
60,
60,
74,
74,
94,
94,
114,
114,
140,
140,
166,
166,
202,
202,
238,
238,
284,
284,
330,
330,
390,
390,
450,
450,
524,
524,
598,
598,
692,
692,
786,
786,
900,
900,
1014,
1014,
1154,
1154,
1294,
1294,
1460,
1460,
1626,
1626,
1828,
1828,
2030,
2030,
2268,
2268,
2506,
2506,
2790,
2790,
3074,
3074,
3404,
3404,
3734,
3734,
4124,
4124,
4514,
4514,
4964,
4964,
5414,
5414,
5938,
5938,
6462,
6462,
7060,
7060,
7658,
7658,
8350,
8350,
9042,
9042,
9828,
9828,
10614,
10614,
11514,
11514,
12414,
12414,
13428,
13428,
14442,
14442,
15596,
15596,
16750,
16750,
18044,
18044,
19338,
19338,
20798,
20798,
22258,
22258,
23884,
23884,
25510,
25510,
27338,
27338,
29166,
29166,
31196,
31196,
33226,
33226,
35494,
35494,
37762,
37762,
40268,
40268,
42774,
42774,
45564,
45564,
48354,
48354,
51428,
51428,
54502,
54502,
57906,
57906,
61310,
61310,
65044,
65044,
68778,
68778,
72902,
72902,
77026,
77026,
81540,
81540,
86054,
86054,
91018,
91018,
95982,
95982,
101396,
101396,
106810,
106810,
112748,
112748,
118686,
118686,
125148,
125148,
131610,
131610,
138670,
138670,
145730,
145730,
153388,
153388,
161046,
161046,
169396,
169396,
177746,
177746,
186788,
186788,
195830,
195830,
205658,
205658,
215486,
215486,
226100,
226100,
236714,
236714,
248228,
248228,
259742,
259742,
272156,
272156,
284570,
284570,
297998,
297998,
311426,
311426,
325868,
325868,
340310,
340310,
355906,
355906,
371502,
371502,
388252,
388252,
405002,
405002,
423046,
423046,
441090,
441090,
460428,
460428,
479766,
479766,
500564,
500564,
521362,
521362,
543620,
543620,
565878,
565878,
589762,
589762,
613646,
613646,
639156,
639156,
664666,
664666,
692004,
692004,
719342,
719342,
748508,
748508,
777674,
777674,
808870,
808870,
840066,
840066,
873292,
873292,
906518,
906518,
942012,
942012,
977506,
977506,
1015268,
1015268,
1053030,
1053030,
1093298,
1093298,
1133566,
1133566,
1176340,
1176340,
1219114,
1219114,
1264678,
1264678,
1310242,
1310242,
1358596,
1358596,
1406950,
1406950,
1458378,
1458378,
1509806,
1509806,
1564308,
};

int main()
{
	int cnt;
	cin >> cnt;
	while (cnt--) {
		int t;
		cin >> t;
		cout << a[t] << endl;
	}
}

/*
int main()
{
	arr[1] = 1;
	for (int i = 2; i < 301; ++i) {
		int half = i / 2;
		for (int j = 1; j <= half; ++j)
			arr[i] += arr[j];
		++arr[i];
		cout << arr[i] << "," << endl;
	}


	int cnt;
	cin >> cnt;
	while (cnt--) {
		int t;
		cin >> t;
		cout << arr[t] << endl;
	}
}
*/
